package main
import(
	"net/http"
	"net/http/httputil"
	"fmt"
	"log"
	"io/ioutil"
	)
//Sheet0
//卖家中心>简易销售统计>销售简报
type Sale struct{
	Date       string
	Salevolume int
	Saleroom   float32
}
type SaleGroup struct{
	Data []Sale
}
func serveSales(w http.ResponseWriter, req *http.Request) {
	fmt.Printf("serveSales\n")
	data, err := httputil.DumpRequest(req, false)
	if err != nil{
		log.Println("ERR=", err)
	}
	log.Println(string(data))

	content, _ := ioutil.ReadAll(req.Body)
	log.Println(string(content))
	//io.WriteString(w, "DONE")
}
//Sheet0
//卖家中心>数据分析>转化率
type ConversionRate struct{
	Date string
	Rate float32
}
func serveConversionRate(w http.ResponseWriter, req *http.Request){
}

//Sheet0
//卖家中心>量子恒道统计>流量概况
type WebTraffic struct{
	Date          string
	PV            int
	UV            int
	AccessDeepthe float32
	StayTime      string
	ReturnRate    float32
}
//two days at most
type WebTrafficGroup struct{
	WTG   []WebTraffic
}
func serveWebTraffic(w http.ResponseWriter, req *http.Request){

}
//Sheet0
//卖家中心>量子恒道统计>首页被访数据
type homepageTraffic struct{
	Date string
	PV   int
	UV   int
    StayTime int //as second
    ClickRate float32
    LostRate float32
}

type homepageTrafficGroup struct {
	HTG []homepageTraffic
}
func serveHomepageTraffic(w http.ResponseWriter, req *http.Request){

}
//Sheet0
//卖家中心>量子恒道统计>宝贝数据被访汇总

type allGoodsTraffic struct{
	Date      string
	TotalView int
	AverageTime string
    LostRate    float32
    UserSession int
	DailyUserSession int
}

func serveGoodsTraffic(w http.ResponseWriter, req *http.Request){

}

//Sheet1
//卖家中心>量子恒道统计>宝贝浏览排行
type goodsTraffic struct{
	Name string
	PV int
	UV int
	AverageTime string
	LostRate float32
}

type goodsTrafficGroup struct{
	Dare string
	Data []goodsTraffic
}

//Sheet2
//卖家中心>量子恒道统计>分类两面排行
type pageClassTraffic struct{
	PV int
	UV int
}

type pageClassTrafficGroup struct{
	Date string
	Data []pageClassTraffic
}

//Sheet3
//卖家中心>量子恒道统计>店内搜索关键词
type internalSearchKeyword struct{
	Count int
	LostRate float32
}

type internalSearchKeywordGroup struct{ 
	Date string
	Data []internalSearchKeyword
}
//Sheet4
//淘宝搜索关键词排行
type taobaoSearchKeyword struct{
	View int
	PageCount int
	LostRate float32
}

type taobaoSearchKeywordGroup struct{
	Date string
	Data []taobaoSearchKeyword
}

//Sheet5
//淘宝流量来源构成

type viewSource struct{
	Source string
	SourceDetail string
	View int
	Percent float32
}

type viewSourceGroup struct{
	Date string
	Data []viewSource
}


	